import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Label;
import java.awt.Font;
import java.awt.TextField;
import java.awt.Button;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;


public class AppletAWTInfo extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel contentPane;
	private TextField txt_addrs;
	private TextField txt_name;
	private TextField txt_tel;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					AppletAWTInfo frame = new AppletAWTInfo();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public AppletAWTInfo() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 366, 250);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		Label label = new Label("\u59D3\u540D :");
		label.setFont(new Font("Dialog", Font.PLAIN, 14));
		label.setBounds(32, 25, 44, 23);
		contentPane.add(label);
		
		Label label_1 = new Label("\u5730\u5740 :");
		label_1.setFont(new Font("Dialog", Font.PLAIN, 14));
		label_1.setBounds(32, 67, 44, 23);
		contentPane.add(label_1);
		
		Label label_2 = new Label("\u96FB\u8A71 :");
		label_2.setFont(new Font("Dialog", Font.PLAIN, 14));
		label_2.setBounds(32, 113, 44, 23);
		contentPane.add(label_2);
		
		txt_name = new TextField();
		txt_name.setFont(new Font("Dialog", Font.PLAIN, 14));
		txt_name.setBounds(82, 25, 108, 23);
		contentPane.add(txt_name);
		
		txt_addrs = new TextField();
		txt_addrs.setFont(new Font("Dialog", Font.PLAIN, 14));
		txt_addrs.setBounds(82, 67, 218, 23);
		contentPane.add(txt_addrs);
		
		txt_tel = new TextField();
		txt_tel.setFont(new Font("Dialog", Font.PLAIN, 14));
		txt_tel.setBounds(82, 113, 108, 23);
		contentPane.add(txt_tel);
		
		Button btn_clear = new Button("\u6E05\u9664");
		btn_clear.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
			txt_name.setText("");
			txt_addrs.setText("");
			txt_tel.setText("");
			
			txt_name.requestFocus();
			
			}
		});
		btn_clear.setFont(new Font("Dialog", Font.PLAIN, 14));
		btn_clear.setBounds(82, 174, 76, 23);
		contentPane.add(btn_clear);
		
		Button btn_sumit = new Button("\u9001\u51FA");
		btn_sumit.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				PersonInfoDialog dialog = new PersonInfoDialog();
				
				dialog.setName(txt_name.getText());
				dialog.setName(txt_addrs.getText());
				dialog.setName(txt_tel.getText());
				
				dialog.setBounds(300, 300, 480, 300);
				dialog.setVisible(true);
			}
		});
		btn_sumit.setFont(new Font("Dialog", Font.PLAIN, 14));
		btn_sumit.setBounds(224, 174, 76, 23);
		contentPane.add(btn_sumit);
	}
}
